package com.rbac.admin.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 菜单实体类
 */
@Data
@TableName("sys_menu")
@Tag(name = "菜单", description = "菜单实体类")
public class SysMenu implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 菜单ID
     */
    @Schema(name = "id", description = "主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 父菜单ID
     */
    @Schema(name = "parentId", description = "父菜单ID")
    private Long parentId;

    /**
     * 菜单名称
     */
    @Schema(name = "menuName", description = "菜单名称")
    private String menuName;

    /**
     * 菜单类型（0-目录，1-菜单，2-按钮）
     */
    @Schema(name = "menuType", description = "菜单类型")
    private Integer menuType;

    /**
     * 路由地址
     */
    @Schema(name = "path", description = "路由地址")
    private String path;

    /**
     * 组件路径
     */
    @Schema(name = "component", description = "组件路径")
    private String component;

    /**
     * 权限标识
     */
    @Schema(name = "permissionCode", description = "权限标识")
    private String permissionCode;

    /**
     * 菜单图标
     */
    @Schema(name = "icon", description = "菜单图标")
    private String icon;

    /**
     * 显示顺序
     */
    @Schema(name = "sortOrder", description = "显示顺序")
    private Integer sortOrder;

    /**
     * 是否显示（0-隐藏，1-显示）
     */
    @Schema(name = "visible", description = "是否显示")
    private Integer visible;

    /**
     * 状态（0-禁用，1-正常）
     */
    @Schema(name = "status", description = "状态")
    private Integer status;

    /**
     * 是否删除（0-未删除，1-已删除）
     */
    @Schema(name = "deleted", description = "是否删除")
    @TableLogic
    private Integer deleted;

    /**
     * 创建时间
     */
    @Schema(name = "createTime", description = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @Schema(name = "updateTime", description = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    /**
     * 备注
     */
    @Schema(name = "remark", description = "备注")
    private String remark;

    @Schema(name = "children", description = "子菜单列表")
    @TableField(exist = false)
    private List<SysMenu> children;
}